package work18;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.concurrent.Callable;

public class TestDate {
        public static void main(String[] args) {
            Date date = new Date();
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
            System.out.println("当前日期为" + format.format(date));
            Calendar cal = Calendar.getInstance();
            cal.set(Calendar.YEAR,2015);
            cal.set(Calendar.MONTH,3);
            cal.set(Calendar.DAY_OF_MONTH,6);
            int week = cal.get(Calendar.WEEK_OF_YEAR);
            System.out.println("2015年4月6日是一年中的第" +week+ "星期。");
            }
        }

